import { addUser } from "../data/users";
import { Handler } from "../types";

export const signup :Handler = (req, res)=>{
    const {username, password} = req.body;

    if(!username?.trim() || !password?.trim()){
        return res.status(400).send("bad username or password");
    }
    addUser({username:username,password:password});
    res.status(201).send("User has been created");
}